<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增部门')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-dept-add">
		<input id="treeId" name="parentId" type="hidden" th:value="${folder.id}"   />
		<div class="form-group">
			<label class="col-sm-3 control-label ">上级栏目：</label>
			<div class="col-sm-8">
				<div class="input-group">
					<input class="form-control" type="text" onclick="selectFolderTree()" id="treeName" readonly="true" th:value="${folder.folderName}">
					<span class="input-group-addon"><i class="fa fa-search"></i></span>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">栏目名称：</label>
			<div class="col-sm-8">
				<input id="folderName" name="folderName" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">URL KEY：</label>
			<div class="col-sm-8">
				<input id="folderKey" name="folderKey" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">描述：</label>
			<div class="col-sm-8">
				<input id="content" name="content" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">排序：</label>
			<div class="col-sm-8">
				<input id="sort" name="sort" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">状态：</label>
			<div class="col-sm-8">
				<label class="radio-inline">
					<input type="radio" name="status"  value="2"   > 隐藏
				</label>
				<label class="radio-inline">
					<input type="radio" name="status"  value="1"   > 显示
				</label>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">跳转地址：</label>
			<div class="col-sm-8">
				<input id="jumpUrl" name="jumpUrl" class="form-control" type="text">
			</div>
		</div>
	</form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
    var prefix = ctx + "question/folder";

    $("#form-folder-add").validate({
        rules:{
            xxxx:{
                required:true,
            },
        },
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-dept-add').serialize());
        }
    }

    /*栏目管理-新增-选择父部门树*/
    function selectFolderTree() {
        var options = {
            title: '栏目选择',
            width: "380",
            url: prefix + "/selectDeptTree/" + $("#treeId").val(),
            callBack: doSubmit
        };
        $.modal.openOptions(options);
    }

    function doSubmit(index, layero){
        var body = layer.getChildFrame('body', index);
        $("#treeId").val(body.find('#treeId').val());
        $("#treeName").val(body.find('#treeName').val());
        layer.close(index);
    }
</script>
</body>
</html>
